Conversation
|
I agree it’s better to configure TypeScript support with the TypeScript plugin, not the language server. It’s still supported by the language server, because this may be needed for some editors. I don’t know if this is the case.
It’s nice that we have this. :)
Isn’t this needed for the markdown language service?
remark plugins register syntax extensions. For example, markdown directives may yield syntax errors unless the |
- Remove TypeScript-dependent tests from language server tests - Tests for TypeScript features (hover, definitions, completions, etc.) should be tested through the TypeScript plugin instead - Update expected capabilities in initialize test - Update test command to only run test/*.test.js - Keep basic language server functionality tests
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #512 +/- ##
==========================================
- Coverage 92.43% 90.24% -2.19%
==========================================
Files 13 13
Lines 1982 2123 +141
==========================================
+ Hits 1832 1916 +84
- Misses 150 207 +57 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add new test directory test/ts/ for TypeScript plugin tests - Tests use @typescript/server-harness to test TypeScript features - Migrate hover, definitions, completions, rename, diagnostics, code-action tests - Update language server tests to remove TypeScript-dependent assertions - Keep basic language server functionality tests - Add test-ts script to run TypeScript plugin tests separately
- Language server now communicates with TypeScript plugin via tsserver - TypeScript plugin registers _mdx:projectInfo command for getting tsconfig path - VSCode extension forwards tsserver requests between language server and TS - Language server reads MDX config (remarkPlugins, etc.) from tsconfig.json - Falls back to finding tsconfig manually when tsserver bridge is unavailable - Add @volar/language-core and @volar/language-service dependencies
Based on Vue Language Tools' implementation, this patch modifies the TypeScript extension's internal code to: 1. Include 'mdx' in the list of supported language modes (jsTsLanguageModes, isSupportedLanguageMode, isTypeScriptDocument) 2. Ensure the MDX TypeScript plugin is loaded with high priority This enables full TypeScript support for MDX files through the TS plugin, including hover, definitions, completions, rename, and diagnostics. If the TypeScript extension is already active when MDX extension loads, the user will be prompted to restart the extension host. Reference: https://github.com/vuejs/language-tools/blob/master/extensions/vscode/src/extension.ts#L286-L365
Re-enable the file watcher to watch MDX files, which is needed for the markdown language service to properly track file changes.
Remove the TypeScript extension patching code as it should be done in a separate PR. This keeps the current PR focused on the tsdk-free changes.
Signed-off-by: Johnson Chu <[email protected]>
This reverts commit 1060174.
Initial checklist
Description of changes
When MDX TypeScript support is already provided through the TS plugin, the language server's TypeScript moving parts seem unnecessary, and I think it can be removed along with the tsdk option to simplify IDE integration.
peerDependencies@typescript/server-harness, which can be found at https://github.com/vuejs/language-tools/blob/master/packages/language-server/testsmarkPlugins,virtualCodePluginsare useful when language server doesn't need TS support. If it is, we need to refer to https://github.com/vuejs/language-tools/blob/073a7cb3bb823479ae5e9bff52850f529714571d/packages/language-server/index.ts#L62 to find tsconfig for each MDX file.